package com.pro.dao;

import com.pro.entity.CoursePlus;
import com.pro.entity.CourseRecord;
import com.pro.entity.JsMicrocirclePlus;
import com.pro.entity.ProductPlus;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author 笑笑
 * @create 2021/11/4下午 03:55
 */
@Repository
public interface CourseRecordMapper {
    //查询所有商品或视频的审核记录
    List<ProductPlus> getAllCourseRecord(ProductPlus productPlus);

    //查询所有商品或视频的审核记录个数
    @Select("SELECT COUNT(id) FROM js_course_record WHERE type = #{type}")
    Integer getAllNum(Integer type);

    //查询所有商品或视频的审核通过个数
    @Select("SELECT COUNT(id) FROM js_course_record WHERE result = 1 AND type = #{type}")
    Integer getNumYes(Integer type);

    //查询所有商品或视频的代审核个数
    @Select("SELECT COUNT(id) FROM js_course_record WHERE result = 2 AND type = #{type}")
    Integer getNum(Integer type);

    //查询所有商品或视频的审核未通过个数
    @Select("SELECT COUNT(id) FROM js_course_record WHERE result = 3 AND type = #{type}")
    Integer getNumNo(Integer type);

    //审批操作
    boolean updateCourseRecord(CourseRecord courseRecord);

    //查询所有课程的审核记录
    List<CoursePlus> getAllCourse(CoursePlus coursePlus);

    //查询所有微圈的审核记录
    List<JsMicrocirclePlus> getAllMicroCircle(JsMicrocirclePlus jsMicrocirclePlus);

    //根据微圈id查询信息
    JsMicrocirclePlus getById(Integer microcircleId);
}
